
// <copyright file="BatchExecuteDelegates.cs" company="Subhadra Software Solutions">
//   
// </copyright>
// <summary>
//   This delegate is called after a db command is executed. If there are N dataTransferObjects, then N times it will be called.
// </summary>

namespace SubhadraSolutions.Sharp.Utils.Data
{
    using System.Data;

    #region Delegates

    /// <summary>
    /// This delegate is called after a db command is executed. If there are N dataTransferObjects, then N times it will be called.
    /// </summary>
    /// <typeparam name="T">
    /// </typeparam>
    /// <param name="command">
    /// The command.
    /// </param>
    /// <param name="dataTransferObject">
    /// The dataTransferObject.
    /// </param>
    /// <param name="returnedValue">
    /// The returned value.
    /// </param>
    /// <param name="tag">
    /// The tag.
    /// </param>
    public delegate void AfterExecuteDelegate<in T>(IDbCommand command, T dataTransferObject, object returnedValue, object tag);

    /// <summary>
    /// This delegate is called before a db command is executed. If there are N dataTransferObjects, then N times it will be called.
    /// </summary>
    /// <typeparam name="T">
    /// </typeparam>
    /// <param name="command">
    /// The command.
    /// </param>
    /// <param name="dataTransferObject">
    /// The dataTransferObject.
    /// </param>
    /// <param name="tag">
    /// The tag.
    /// </param>
    public delegate void BeforeExecuteDelegate<in T>(IDbCommand command, T dataTransferObject, object tag);

    /// <summary>
    ///     This delegate is called before performing the batch db operation.
    /// </summary>
    /// <param name="command">The command.</param>
    /// <param name="tag">The tag.</param>
    public delegate void InitializeCommandDelegate(IDbCommand command, object tag);

    #endregion Delegates
}